package main

import (
	"fmt"
	"github.com/tietang/props/ini"
	"github.com/tietang/props/kvs"
	"time"
)

func main() {
	//go get -u github.com/tietang/props
	file := kvs.GetCurrentFilePath("config.ini", 1) //skip代表跳过的层级
	conf := ini.NewIniFileConfigSource(file)
	port := conf.GetIntDefault("app.server.port", 18080) //int
	fmt.Println(port)
	fmt.Println(conf.GetDefault("app.name", "unknow"))            //string
	fmt.Println(conf.GetBoolDefault("app.enabled", false))        //bool
	fmt.Println(conf.GetDurationDefault("app.time", time.Second)) //time
}
